//
//
//

#include "16balls.h"

#include "Frame.h"
#include "Disposals.h"
#include "Application.h"
#include "StyleSimpleAgg.h"
#include "Layout.h"

int newa_main()
{
	newa::styleMan().applyStyle( &newa::SimpleAggStyle() );

	newa::FrameWithHeaderPtr frame = new newa::FrameWithHeader;

	newa::Settle< newa::Disposals::WinOwner > ( frame->elem(), newa::Screen() );
	frame->rect( newa::Rect( 300, 200, 320, 240) );


	Loki::SmartPtr< izin::WidgetHgram > whgram = new izin::WidgetHgram;
	newa::Settle< newa::Disposals::WinOwner > ( whgram->elem(), frame->site() );
	whgram->hgram("iiIyYy");
	whgram->rect( newa::Rect( 0, 0, 100, 100 ) );

	Loki::SmartPtr< izin::SixteenBallsPool > pool = new izin::SixteenBallsPool;
	newa::Settle< newa::Disposals::WinOwner > ( pool->elem(), frame->site() );
	pool->rect( newa::Size( 200, 200 ) );
	pool->throwDice();

	newa::Layouts::Align align( newa::Layouts::LEFT | newa::Layouts::TOP );
	align.listen( *frame->site() );
	align.manage( *whgram->elem() );
	
	newa::Layouts::Align align2( newa::Layouts::RIGHT | newa::Layouts::BOTTOM );
	align2.listen( *frame->site() );
	align2.manage( *pool->elem() );
	
	return newa::appInstance().run();
}